﻿using System.Web.Services;
using Microsoft.SharePoint;

namespace UpdateContentType
{
    /// <summary>
    /// Summary description for TFSWebService
    /// </summary>
    [WebService(Namespace = "http://www.codeplex.com/UpdateContentType/TFSWebService")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    public class TFSWebService : System.Web.Services.WebService
    {
        [WebMethod]
        public int UpdateTemplate(string url, string fileName, byte[] file)
        {
            int ret = 0;

            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                Common c = new Common(url, fileName, file);
                ret = c.UpdateTemplate();
                
            });

            return ret;
        }
    }
}
